#!/usr/bin/env python
# vim: set filetype=python expandtab tabstop=2 shiftwidth=2 autoindent smartindent:
# -*- coding: utf-8 -*-
#
import os
import wsgiref.handlers
#import cgi
import datetime
import logging

from google.appengine.api import mail
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine.api import users
from google.appengine.api import images

from google.appengine.ext import db
#from google.appengine.ext.db import djangoforms
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp.util import run_wsgi_app

from django.utils import simplejson

from printenv import PrintEnvironment
from savePoint import SavePoint
from guestbook import *
from fetchurl import *
from jsonrpc import *

logging.getLogger().setLevel(logging.DEBUG)
    
# path router
application = webapp.WSGIApplication([
  ('/', MainPage),
  ('/img', Image),
  ('/sign', Guestbook),
  ('/printenv', PrintEnvironment),
  ('/savepoint', SavePoint),
  ('/fetch', Fetch),
  ('/fetchme', Fetchme),
  ('/rpc', RPCHandler)
], debug=True)


def main():
  run_wsgi_app(application)


if __name__ == '__main__':
  main()
  
